<?php
namespace Plugin\Organization\Schema;

use Plugin\Organization\Model\RdOrganizeUserStand;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 用户管理站点
 */
#[Schema(title: 'RdOrganizeUserStandSchema')]
class RdOrganizeUserStandSchema implements \JsonSerializable
{
    #[Property(property: 'user_id', title: '用户ID', type: 'bigint')]
    public string $user_id;

    #[Property(property: 'stand_id', title: '所属工区ID', type: 'bigint')]
    public string $stand_id;

    #[Property(property: 'role', title: '角色', type: 'tinyint')]
    public string $role;

    #[Property(property: 'status', title: '状态', type: 'tinyint')]
    public string $status;

    #[Property(property: 'created_by', title: '创建者', type: 'bigint')]
    public string $created_by;

    #[Property(property: 'updated_by', title: '更新者', type: 'bigint')]
    public string $updated_by;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'remark', title: '备注', type: 'varchar')]
    public string $remark;




    public function __construct(RdOrganizeUserStand $model)
    {
       $this->user_id = $model->user_id;
       $this->stand_id = $model->stand_id;
       $this->role = $model->role;
       $this->status = $model->status;
       $this->created_by = $model->created_by;
       $this->updated_by = $model->updated_by;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->remark = $model->remark;

    }

    public function jsonSerialize(): array
    {
        return ['user_id' => $this->user_id ,'stand_id' => $this->stand_id ,'role' => $this->role ,'status' => $this->status ,'created_by' => $this->created_by ,'updated_by' => $this->updated_by ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'remark' => $this->remark];
    }
}